package com.newlink.building.common_base.event

import com.newlink.building.common_base.model.bean.AlarmNotifyBean1
import java.io.Serializable

/**
 * @author wangyang
 * @date 2023/5/9
 * @description 待读消息数的Event
 */
//class ReadCountActionEvent(var bean : EmergencyMsgBean? ,var readCount: Int)
class ReadCountActionEvent(var type: Int, var index: Int)
data class RecordReadCountActionEvent(
    var logOpen: Int = 0,
    var logCall: Int = 0,
    var security: Int = 0
)

class AlarmActionEvent(var alarmBean: AlarmNotifyBean1, var sessionId: String?)

/**
 * 紧急消息
 * @property requestType String
 * @property `data` Data
 * @constructor
 */
data class EmergencyMsgBean(
    val currentTime: String,
    val `data`: Data,
    val msgId: String,
    val msgType: String,
    val version: String
) : Serializable {
    data class Data(
        val id: Long,
        val title: String,
        val content: String,
        val readFlag: Boolean,
        val createTime: String,
        val createTimeUnix: Long
    ) : Serializable
}


/**
 * 安防通知实体类
 * @property currentTime String
 * @property `data` Data
 * @property msgId String
 * @property msgType String
 * @property version String
 * @constructor
 * 		"id": 123123123123, //用户处理消息时返回给PC服务器
 * 		"mac": "123123123",
 * 		"devName": "12312312",
 * 		"sip": "",
 * 		"alarmType": 0, //报警类型,0：输入报警，1：防拆，2：移动侦测
 * 		"alarmDesc": "", //输入报警描述，如 客厅烟感
 * 		"alarmTime": "2023-04-10 16:37:21" //报警时间,
 * 		"handle": "", //0未处理，1已处理
 * 		"alarmIndex": 0,
 */
data class AlarmNotifyBean(
    val currentTime: String = "",
    val `data`: Data,
    val msgId: String = "",
    val msgType: String = "",
    val version: String = "",
    var fromRecord: Boolean = false
) : BaseActionBean, Serializable {
    data class Data(
        val id: Long,
        val mac: String,
        val devName: String,
        val sip: String?,
        val alarmType: Int,
        val alarmDesc: String,
        val alarmTime: String,
        val handle: Int,
        val alarmIndex: Int
    ) : Serializable

}

/**
 * 安防处理通知实体类
 * @property currentTime String
 * @property `data` Data
 * @property msgId String
 * @property msgType String
 * @property version String
 * @constructor
 * "id": 123123123123, //用户处理消息时返回给PC服务器
 * "mac": "123123123",
 * "devName": "12312312",
 * "sip": "",
 * "alarmType": 0, //报警类型,0：输入报警，1：防拆，2：移动侦测
 * "alarmDesc": "", //输入报警描述，如 客厅烟感
 * "alarmTime": "2023-04-10 16:37:21" //报警时间,
 * "handle": "", //0未处理，1已处理
 * "alarmIndex": 0,
 * "handleTime":"",
 * "handleTimeUnix":10000L
 */
data class AlarmNotifyHandleBean(
    val currentTime: String,
    val `data`: Data,
    val msgId: String,
    val msgType: String,
    val version: String
) : BaseActionBean, Serializable {
    data class Data(
        val id: Long,
        val mac: String,
        val devName: String,
        val sip: String?,
        val alarmType: Int,
        val alarmDesc: String,
        val alarmTime: String,
        val alarmIndex: Int,
        val handleTime: String,
        val handleTimeUnix: Long,
        var handle: Int = 1
    ) : Serializable

}

